package com.example.common.enums;

/**
 * @Author wxy
 * @Date 2020/11/27 16:59
 * @Version 1.0
 */
public enum PayType {

    ALIPAY(1, "支付宝"),
    WCPAY(2, "微信"),
    MIPAY(3, "医保"),
    ;

    private final Integer value;
    private final String description;

    PayType(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public Integer getName() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static String valueToDesc(Integer value) {
        if (value == 1L) {
            return ALIPAY.getDescription();
        } else if (value == 2L) {
            return WCPAY.getDescription();
        } else if (value == 3L) {
            return MIPAY.getDescription();
        }
        return null;
    }
}
